let app = getApp();
var applet_park_api_url = app.globalData.applet_park_api_url;
const {
  requestDataparams
} = require('../../../utils/request.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    lists: [],
    cordList: [{
      id: 1,
      city: '苏A',
      cord: '930H2',
      date: '2020-04-10',
      time: '15:33',
      add: '中航科技大厦',
      num: '15698756412345',
      stoptime: '04:58',
      price: '48.00',
      y_price: '0.00',
      s_price: '30.00'
    }]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    that.getDatas();
  },
  getDatas() { //获取数据
    var that = this;
    var openId = app.globalData.openId || wx.getStorageInfoSync('OPENID');
    requestDataparams('/api/unifiedOrder/queryUnifiedList', {
      openId: openId,
      orderType: "04"
    }, 'POST', 'json').then(response => {
      
      if (response.data.code == 0) {
        var datas = response.data.data.records;
        for (var i = 0; i < datas.length; i++) {
          datas[i].totalMoney = parseInt(datas[i].totalMoney) / 100;
          datas[i].realityMoney = parseInt(datas[i].realityMoney) / 100
        }
        
        that.setData({
          lists: datas
        })
        
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})